#!/bin/bash
echo ""
echo "install subversion, we are going to use it to fetch the scripts and codes from the repository"
echo "also install your favorite text editor, we will need to edit config files"
read -p "[press enter to continue...]"
apt-get update && apt-get install nano subversion
echo ""
echo "cd into the home directory and fetch the repository"
cd ~/
read -p "[press enter to continue...]"
svn checkout http://kth-wsn-longrange-radio-uplink.googlecode.com/svn/trunk/ wsn-uplink
echo ""
echo "now I'm going to fix the permissions of usb devices for in case"
echo "plug in all the usb serial cables(FTDI)"
read -p "[press enter to continue...]"
chmod 666 /dev/ttyUSB*
echo ""
echo "cd into the directory where soundmodem installation script resides"
cd wsn-uplink/voyage_soundmodem
echo "run the script, it will install alsa-base, alsa-oss, alsa-tools and alsa-utils"
echo "after that it will install soundmodem and create config files and link them to the current directory"
read -p "[press enter to continue...]"
chmod +x setup_soundmodem.sh
./setup_soundmodem.sh
echo ""
echo "now it's time to edit the config files"
echo "change the addresses and callsigns according to your will"
echo "also enter the /dev/ttyUSB path of the PTT device(FTDI cable)"
read -p "[press enter to continue...]"
nano /etc/ax25/soundmodem.conf
echo ""
echo "change the port name according to your callsign(helps remembering)"
echo "but the callsign in this file MUST match the callsign in soundmodem.conf"
read -p "[press enter to continue...]"
nano /etc/ax25/axports
echo ""
echo "we are done!"
echo "when you run soundmodem your interface will show up in ifconfig"
echo "don't forget to plugin the usb audio device!"
read -p "press enter to finish..."